/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "georeferencedby")
@NamedQueries({
    @NamedQuery(name = "Georeferencedby.findAll", query = "SELECT g FROM Georeferencedby g"),
    @NamedQuery(name = "Georeferencedby.findByIdgeoreferencedby", query = "SELECT g FROM Georeferencedby g WHERE g.idgeoreferencedby = :idgeoreferencedby"),
    @NamedQuery(name = "Georeferencedby.findByGeoreferencedby", query = "SELECT g FROM Georeferencedby g WHERE g.georeferencedby = :georeferencedby")})
public class Georeferencedby implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idgeoreferencedby")
    private Integer idgeoreferencedby;
    @Column(name = "georeferencedby")
    private String georeferencedby;
    @JoinTable(name = "localitygeoreferencedby", joinColumns = {
        @JoinColumn(name = "idgeoreferencedby", referencedColumnName = "idgeoreferencedby")}, inverseJoinColumns = {
        @JoinColumn(name = "idlocalityelement", referencedColumnName = "idlocalityelement")})
    @ManyToMany(fetch = FetchType.LAZY)
    private List<Localityelement> localityelementList;

    public Georeferencedby() {
    }

    public Georeferencedby(Integer idgeoreferencedby) {
        this.idgeoreferencedby = idgeoreferencedby;
    }

    public Integer getIdgeoreferencedby() {
        return idgeoreferencedby;
    }

    public void setIdgeoreferencedby(Integer idgeoreferencedby) {
        this.idgeoreferencedby = idgeoreferencedby;
    }

    public String getGeoreferencedby() {
        return georeferencedby;
    }

    public void setGeoreferencedby(String georeferencedby) {
        this.georeferencedby = georeferencedby;
    }

    public List<Localityelement> getLocalityelementList() {
        return localityelementList;
    }

    public void setLocalityelementList(List<Localityelement> localityelementList) {
        this.localityelementList = localityelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idgeoreferencedby != null ? idgeoreferencedby.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Georeferencedby)) {
            return false;
        }
        Georeferencedby other = (Georeferencedby) object;
        if ((this.idgeoreferencedby == null && other.idgeoreferencedby != null) || (this.idgeoreferencedby != null && !this.idgeoreferencedby.equals(other.idgeoreferencedby))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Georeferencedby[idgeoreferencedby=" + idgeoreferencedby + "]";
    }

}
